#ifndef _TC_LOGIC
#define _TC_LOGIC


#include <tcCommon/tc_common.h>
#include <tcCommon/tc_math.h>


#ifdef __cplusplus
extern "C" 
{
#endif

// GS stands for Game State
enum 
{
	TC_GS_PLAYER_ONE_WIN = 0,
	TC_GS_PLAYER_TWO_WIN = 1,
	TC_GS_TIE = 2,
	TC_GS_FIGHTING = 3,
	TC_GS_USING_POWERUP_PROP = 4,
	TC_GS_USING_FORBID_PROP = 5,
	TC_GS_USING_ENLARGE_PROP = 6,
	TC_GS_USING_CHANGE_PROP = 7,
};

enum 
{
	TC_PROP_POWERUP = 0,
	TC_PROP_FORBID,
	TC_PROP_ENLARGE,
	TC_PROP_CHANGE,
	TC_PROP_COUNT,
};

tcExport void tc_logic_init();
tcExport void tc_logic_exit();

tcExport void tc_logic_restart(tcType player);

tcExport tcType tc_logic_get_current_player();

tcExport BOOL tc_logic_get_valid();
tcExport BOOL tc_logic_get_chessman_valid(int id);

tcExport BOOL tc_logic_select_chessman(int id);
tcExport int tc_logic_get_selected_chessman();

tcExport void tc_logic_shoot_chessman(int id, tc_vector2 impulse);

tcExport void tc_logic_update(float dt);

tcExport BOOL tc_logic_use_prop(tcType prop_type, tcType player);

tcExport tcType tc_logic_get_game_state();

tcExport int tc_logic_get_player_score(tcType player);

tcExport int tc_logic_get_prop_score(tcType prop_type);


#ifdef __cplusplus
}
#endif

#endif